{include file="public/header" /}
<style type="text/css">
/* TAB */
.nav-tabs.nav>li>a {
    padding: 10px 25px;
    margin-right: 0;
}
.nav-tabs.nav>li>a:hover,
.nav-tabs.nav>li.active>a {
    border-top: 3px solid #1ab394;
    padding-top: 8px;
}
.nav-tabs>li>a {
    color: #A7B1C2;
    font-weight: 500;  
    margin-right: 2px;
    line-height: 1.42857143;
    border: 1px solid transparent;
    border-radius: 0;
}
</style>

<body class="gray-bg">
<div class="wrapper wrapper-content animated">
    <div class="row">
        <div class="col-sm-12">
            <div class="ibox float-e-margins">
                <div class="ibox-title">
                    <h5>网站配置</h5>
                    <div class="ibox-tools">
                        <a class="collapse-link">
                            <i class="fa fa-chevron-up"></i>
                        </a>
                        <a class="dropdown-toggle" data-toggle="dropdown" href="form_basic.html#">
                            <i class="fa fa-wrench"></i>
                        </a>
                        <a class="close-link">
                            <i class="fa fa-times"></i>
                        </a>
                    </div>
                </div>
                <div class="ibox-content">           
                    <div class="panel-body">                      
                        <div class="builder-tabs builder-form-tabs">
                            <ul class="nav nav-tabs">
                                {volist name="Think.config.config_group_list" id="group"}
                                    <li {eq name="id" value="$key"}class="active"{/eq}><a href="{:url('?id='.$key)}">{$group}配置</a></li>
                                {/volist}           
                            </ul>
                        </div>
                        <div class="form-group"></div>
                    
                    <div class="builder-container">
                        <div class="row">
                            <div class="col-xs-12">
                                <form action="{:url('save')}" method="post" class="form-horizontal">  
                                    <div class="hr-line-dashed"></div>                                
                                    {volist name="list" id="config"}
                                        <div class="form-group">
                                            <label class="col-sm-2 control-label">{$config.title}：</label>
                                            <div class="input-group col-sm-4">
                                                {switch name="config.type"}
                                                {case value="0"}
                                                    <input type="text" class="form-control" name="config[{$config.name}]" value="{$config.value}">
                                                    <span class="help-block m-b-none"><i class="fa fa-info-circle"></i> {$config.remark}</span>
                                                {/case}
                                                {case value="1"}
                                                    <input type="text" class="form-control" name="config[{$config.name}]" value="{$config.value}">
                                                    <span class="help-block m-b-none"><i class="fa fa-info-circle"></i> {$config.remark}</span>
                                                {/case}
                                                {case value="2"}
                                                    <textarea class="form-control" type="text" rows="4" name="config[{$config.name}]">{$config.value}</textarea>
                                                    <span class="help-block m-b-none"><i class="fa fa-info-circle"></i> {$config.remark}</span>
                                                {/case}
                                                {case value="3"}
                                                    <textarea class="form-control" type="text" rows="4" name="config[{$config.name}]">{$config.value}</textarea>
                                                    <span class="help-block m-b-none"><i class="fa fa-info-circle"></i> {$config.remark}</span>
                                                {/case}
                                                {case value="4"}
                                                    <select class="form-control m-b chosen-select" name="config[{$config.name}]">
                                                        {volist name=":parse_config_attr($config['extra'])" id="vo"}
                                                            <option value="{$key}" {eq name="config.value" value="$key"}selected{/eq}>{$vo}</option>
                                                        {/volist}
                                                    </select>
                                                    <span class="help-block m-b-none"><i class="fa fa-info-circle"></i> {$config.remark}</span>
                                                {/case}
                                                {/switch}                                           
                                            </div>
                                            <div class="hr-line-dashed"></div>
                                        </div>
                                    {/volist}
                                    <div class="hr-line-dashed"></div>
                                    <div class="form-group">
                                        <div class="col-sm-4 col-sm-offset-3">
                                            <button class="btn btn-primary" type="submit"><i class="fa fa-save"></i> 保存信息</button>&nbsp;&nbsp;&nbsp;
                                            <a class="btn btn-danger" href="javascript:history.go(-1);"><i class="fa fa-close"></i> 返回</a>
                                        </div>
                                    </div>                               
                                </form>
                            </div>
                        </div>
                    </div>              
                </div>
				</div>

                </div>
            </div>
        </div>
    </div>
</div>
{include file="public/footer" /}

<script type="text/javascript">

    var config = {
        '.chosen-select': {},                    
    }
    for (var selector in config) {
        $(selector).chosen(config[selector]);
    }
</script>
</body>
</html>
